package com.example.springiocdi2;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class BeanConfig {
    @Bean("u1")
    public User user1() {
        User user = new User();
        user.setName("zhangsan");
        user.setAge(17);
        return user;
    }


    @Bean("u2")
    public User user2() {
        User user = new User();
        user.setName("lisi");
        user.setAge(18);
        return user;
    }
}
